from django.contrib import admin

# Register your models here.
from .models import PostList, PostCategory
import xadmin

class PostAdmin(object):
    list_display = ('title', 'summary', 'like_count', 'share_count', 'category', 'publish_time', 'user')
    search_fields = ('title', 'user', 'category')
    readonly_fields = ('title', 'summary', 'like_count', 'share_count', 'category', 'publish_time', 'user')
    show_detail_fields = ('user',)


class PostCategoryAdmin(object):
    list_display = ('name',)


xadmin.site.register(PostList, PostAdmin)
xadmin.site.register(PostCategory, PostCategoryAdmin)